// index.js
var app = getApp()
console.log(app.globalData.array)
Page({
  data: {
    date:" ",
    month:"",
    day:" ",
    array1: ['c语言', 'c++语言', 'java语言', 'python语言','微信小程序开发','MySql数据库开发','Linux开发','matlab学习','Arduino语法',
   'C#语言','PHP语言','算法进阶'],
    "items": [
      {
        "id": "1",
        "imageUrl": "/res/baiyang.jpg",
        "content": "c语言",
        "urlLink":"/pages/xingzuo1/xingzuo1"
      },
      {
        "id": "2",
        "imageUrl": "/res/jinniu.jpg",
        "content": "c++语言",
        "urlLink":"/pages/xingzuo2/xingzuo2"
      },
      {
        "id": "3",
        "imageUrl": "/res/shuangzi.jpg",
        "content": "java语言",
        "urlLink":"/pages/xingzuo3/xingzuo3"
      },
      {
        "id": "4",
        "imageUrl": "/res/juxie.jpg",
        "content": "python语言",
        "urlLink":"/pages/xingzuo4/xingzuo4"
      },
      {
        "id": "5",
        "imageUrl": "/res/shizi.jpg",
        "content": "微信小程序开发",
        "urlLink":"/pages/xingzuo5/xingzuo5"
      },
      {
        "id": "6",
        "imageUrl": "/res/chunv.jpg",
        "content": "MySql数据库开发",
        "urlLink":"/pages/xingzuo6/xingzuo6"
      },
      {
        "id": "7",
        "imageUrl": "/res/tiancheng.jpg",
        "content": "Linux开发",
        "urlLink":"/pages/xingzuo7/xingzuo7"
      },
      {
        "id": "8",
        "imageUrl": "/res/tianxie.jpg",
        "content": "matlab学习",
        "urlLink":"/pages/xingzuo8/xingzuo8"
      },
      {
        "id": "9",
        "imageUrl": "/res/sheshou.jpg",
        "content": "Arduino语法",
        "urlLink":"/pages/xingzuo9/xingzuo9"
      },
      {
        "id": "10",
        "imageUrl": "/res/mojie.jpg",
        "content": "C#语言",
        "urlLink":"/pages/xingzuo10/xingzuo10"
      },
      {
        "id": "11",
        "imageUrl": "/res/shuiping.jpg",
        "content": "PHP语言",
        "urlLink":"/pages/xingzuo11/xingzuo11"
      },
      {
        "id": "12",
        "imageUrl": "/res/shuangyu.jpg",
        "content": "算法进阶",
        "urlLink":"/pages/xingzuo12/xingzuo12"
      }
    ]

  },
  // 事件处理函数
  bindViewTap() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  onLoad() {
    if (wx.getUserProfile) {
      this.setData({
        canIUseGetUserProfile: true
      })
    }
  },
  getUserProfile(e) {
   
  },
  binddatechange:function(e){
    console.log(e.detail.value)
    this.setData({
      date:e.detail.value,
    })
    if (this.data.date==0) {
      app.globalData.array=1;
    }
    if(this.data.date==1){
      app.globalData.array=2;
    }
    if(this.data.date==2){
      app.globalData.array=3;
    }
    if(this.data.date==3){
      app.globalData.array=4;
    }
    if(this.data.date==4){
      app.globalData.array=5;
    }
    if(this.data.date==5){
      app.globalData.array=6;
    }
    if(this.data.date==6){
      app.globalData.array=7;
    }
    if(this.data.date==7){
      app.globalData.array=8;
    }
    if(this.data.date==8){
      app.globalData.array=9;
    }
    if(this.data.date==9){
      app.globalData.array=10;
    }
    if(this.data.date==10){
      app.globalData.array=11;
    }
    if(this.data.date==10){
      app.globalData.array=12;
    }
    console.log(app.globalData.array)
    if (app.globalData.array==1) {
      wx.navigateTo({
        url: '/pages/xingzuo1/xingzuo1',
      })
    }
    if (app.globalData.array==2) {
      wx.navigateTo({
        url: '/pages/xingzuo2/xingzuo2',
      })
    }
    if (app.globalData.array==3) {
      wx.navigateTo({
        url: '/pages/xingzuo3/xingzuo3',
      })
    }
    if (app.globalData.array==4) {
      wx.navigateTo({
        url: '/pages/xingzuo4/xingzuo4',
      })
    }
    if (app.globalData.array==5) {
      wx.navigateTo({
        url: '/pages/xingzuo5/xingzuo5',
      })
    }
    if (app.globalData.array==6) {
      wx.navigateTo({
        url: '/pages/xingzuo6/xingzuo6',
      })
    }
    if (app.globalData.array==7) {
      wx.navigateTo({
        url: '/pages/xingzuo7/xingzuo7',
      })
    }
    if (app.globalData.array==8) {
      wx.navigateTo({
        url: '/pages/xingzuo8/xingzuo8',
      })
    }
    if (app.globalData.array==9) {
      wx.navigateTo({
        url: '/pages/xingzuo9/xingzuo9',
      })
    }
    if (app.globalData.array==10) {
      wx.navigateTo({
        url: '/pages/xingzuo10/xingzuo10',
      })
    }
    if (app.globalData.array==11) {
      wx.navigateTo({
        url: '/pages/xingzuo11/xingzuo11',
      })
    }
    if (app.globalData.array==12) {
      wx.navigateTo({
        url: '/pages/xingzuo12/xingzuo12',
      })
    }

    


    
    
}
})
